<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var arr = [12, 4, 56, 34, 99, 56, 67, 87, 56]
    var m = Math.max(...arr)
    console.log(m);
    var n = Math.min(...arr)
    console.log(n);

    // m = Math.max.call(arr, 12, 4, 56, 34, 99, 56, 67, 87, 56)
    // console.log(m);
    n = Math.min.apply(arr, arr)
    console.log(n);
  </script>
</body>

</html>